#ifndef PID_DEMO_H
#define PID_DEMO_H

#include "mid/pid.h"

#define PID_STEP            0.1
#define TARGET_STEP         1

#define MAX_SPEED_TARGET    110
#define MAX_ANGLE_TARGET    360

typedef enum eUpdatePID
{
    ePID_P = 0x01,
    ePID_I = 0x02,
    ePID_D = 0x04,
    ePID_TARGET = 0x08,
    ePID_ALL = ePID_P | ePID_I | ePID_D | ePID_TARGET,
} eUpdatePID;

typedef enum ePIDTargetButtonID
{
    ePID_BTN_NONE = -1,
    ePID_BTN_P = 0,
    ePID_BTN_I,
    ePID_BTN_D,
    ePID_BTN_TARGET,
    ePID_BTN_CNT
} ePIDTargetButtonID;

void MotorSpeedControl(PID* pid);

void MotorDistanceControl(PID* pid);

void UpdatePIDText(PID* pid, eUpdatePID flag);
void UpdatePIDTargetValue(PID* pid, int delta);
void UpdatePIDTargetText(PID* pid);
#endif